package com.test.jdbc.driver;

import com.test.jdbc.connection.MysqlConnectionImpl;
import com.test.jdbc.connection.RgsConnection;
import com.test.jdbc.manager.DriverManager;

/**
 * @author RenGaoshuai
 * @date 2024/6/3 10:55
 * @description
 */
public class MysqlDriver implements Driver{

    /**
     * 注册到Drivermanager的集合中
     */
    static{
        DriverManager.register(new MysqlDriver());
    }


    @Override
    public RgsConnection getConnection(String url) {
        if (url.startsWith("jdbc:mysql")) {
            return new MysqlConnectionImpl();

        }
        return null;
    }
}
